package com.example.mydemoproject.job;

import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

import java.sql.Timestamp;

/**
 * @author LiuZhiYong
 * @description 示例带参数的定时任务
 * @date 2022-11-25
 **/
@Slf4j
@Data
public class SampleParamJob implements Job {

    /**
     * 若参数变量名修改 QuartzJobController中也需对应修改
     */
    private String parameter;

    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        log.info("带参数的示例定时任务时间: {}, 参数:{}", new Timestamp(System.currentTimeMillis()), parameter);
    }
}
